<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link  rel="stylesheet" type="text/css" href="/Public/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/Public/css/bootstrap-rtl.css" />
    <link rel="stylesheet" type="text/css" href="/Public/css/oyghan-common.css" />
    <script type="text/javascript" src="/Public/js/jquery-3.1.1.js"></script>
    <script type="text/javascript" src="/Public/js/bootstrap.js"></script>
    <script type="text/javascript" src="/Public/js/layer.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header ">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Blog v1.0</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="<?php if( CONTROLLER_NAME == 'Index' ): ?>active<?php endif; ?>"><a href="<?php echo U('Index/index');?>">باش بەت <span class="sr-only">(current)</span></a></li>
                <li  class="<?php if( CONTROLLER_NAME == 'Content' ): ?>active<?php endif; ?>"><a href="<?php echo U('Content/index');?>">مەزمۇن</a></li>
                <li class="<?php if( CONTROLLER_NAME == 'Tools' ): ?>active<?php endif; ?>"><a href="<?php echo U('Tools/index');?>">ئىقتىدار</a></li>
                <li class="<?php if( CONTROLLER_NAME == '' ): ?>active<?php endif; ?>"><a href="#">ئەزا</a></li>

            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">ئالدى بەت</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false"><span>ئەسسالامۇ ئەلەيكۇم! </span>&nbsp;<?php echo ($_SESSION['blog_admin']['name']); ?></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">ئارخىپ باشقۇرۇش</a></li>
                        <li><a href="<?php echo U('Index/quite');?>">بىخەتەر چىكىنىش</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<div class="container">
    <div class="row">
        <div class="col-md-2">
            
    <div class="btn-group-vertical">
        <a  class="btn btn-default  <?php if( CONTROLLER_NAME == 'Category' ): ?>active<?php endif; ?>" href="<?php echo U('Category/index');?>">كاتىگورىيە باشقۇرۇش</a>
        <a  class="btn btn-default  <?php if( CONTROLLER_NAME == 'Tag' ): ?>active<?php endif; ?>" href="<?php echo U('Tag/index');?>" >خەتكۈچ باشقۇرۇش</a>
        <a  class="btn btn-default  <?php if( CONTROLLER_NAME == 'Article' ): ?>active<?php endif; ?>" href="<?php echo U('Article/index');?>" >يازما باشقۇرۇش</a>
    </div>
        </div>
        <div class="col-md-10">
            <div class="page-header"><h3><?php echo ($page_title); ?></h3></div>
            <div class="btn-group  role="group" aria-label="" style="margin-bottom:10px;" >
            <a  class="btn btn-default <?php if(CONTROLLER_NAME == 'Category' && ACTION_NAME == 'index'): ?>active<?php endif; ?>" href="<?php echo U('Category/index');?>">كاتىگورىيەلەر</a>&nbsp;
            <a  class="btn btn-default <?php if(CONTROLLER_NAME == 'Category' && ACTION_NAME == 'add'): ?>active<?php endif; ?>" href="<?php echo U('Category/add');?>" style="margin-bottom:10px;">كاتىگورىيە قۇشۇش</a>
        </div>
        <form action="<?php echo U('Category/saveHandler');?>" method="post">
            <input type="hidden" name="id" value="<?php echo ($categorys['id']); ?>" />
            <div class="form-group">
                <label class="label  label-success">كاتىگورىيە نامى</label>
                <input type="text" class="form-control"  placeholder="كاتىگورىيە نامى" name="cname"  value="<?php echo ($categorys['cname']); ?>">
            </div>
            <div class="form-group">
                <input type="text" class="form-control"  placeholder="تەرتىپ" name="sort" value="<?php echo ($categorys['sort']); ?>">
            </div>
            <div class="form-group">
                <select class="form-control" name="pid">
                    <option value="0">ئانا كاتىگورىيە</option>
                      <?php if(is_array($category)): foreach($category as $key=>$c): ?><option value="<?php echo ($c['id']); ?>" <?php if($c['id'] == $categorys['pid']): ?>selected<?php endif; ?> >
                            <?php if($c['pid'] != 0 ): echo str_repeat('&nbsp;',$c['level']*8); endif; ?>|<?php echo ($c['cname']); ?></option><?php endforeach; endif; ?>

                </select>
            </div>
            <div class="radio">
                <label class="radio-inline">
                    <input type="radio" name="status" id="inlineRadio1" value="1" <?php if($categorys['status']==1): ?>checked<?php endif; ?>>ئۇچۇق
                </label>
                <label class="radio-inline">
                    <input type="radio" name="status" id="inlineRadio2" value="0" <?php if($categorys['status']==0): ?>checked<?php endif; ?>>تاقاق
                </label>
            </div>
            <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span>ساقلاش</button>
        </form>
    </div>
</div>
</div>
</div>
</body>
</html>